import React from 'react';
import { BrowserRouter, useRoutes } from "react-router-dom"
import rootRoutes from "./routes"
import './App.css';

function App() {
  //使用hooks函数 useRoutes得到路由组件dom结构
  const GetRoutes = () => useRoutes(rootRoutes)
  return (
    <div className="App">
      <header className="App-header">
        {/* 首页 */}
        {/* 根组件 */}
        <BrowserRouter>
          <GetRoutes />
        </BrowserRouter>
      </header>
    </div>
  );
}

export default App;
